<#include "/${parameters.templateDir}/simple/div-close.ftl" />
<#if parameters.syncId?default(false) == true>
<input type="hidden" name="<#if parameters.idName?exists>${parameters.idName?html}<#else>id</#if>"<#rt/> 
 id="${parameters.id?html}_id"<#rt/>
/>
</#if>
<script language="javascript">
<#if parameters.buttonOptions?exists>
	Geni.ToolBar.addButtonOptions(${parameters.buttonOptions?html});
</#if>
<#if parameters.syncId?default(false) == true>
	Geni.ToolBar.idName="${parameters.id?html}_id";
</#if>
<#if parameters.callBackOnClick?exists>
	Geni.ToolBar.setCallBackOnClick(${parameters.callBackOnClick?html});
</#if>
<#if parameters.callBackOnDoubleClick?exists>
	Geni.ToolBar.setCallBackOnDoubleClick(${parameters.callBackOnDoubleClick?html});
</#if>

<#assign options = "{" />
<#assign buttonOptions = "{" />
<#assign hasDefault = false />
<#assign hasClick = false />
<#list tag.columns as column>
	<#if column.parameters.defaultStatus?exists>
		<#if hasDefault == true>
			<#assign options = options + "," />
		<#else>
			<#assign hasDefault = true />
		</#if>
		<#assign options = options + "'" + column.parameters.id?html + "':'" + column.parameters.defaultStatus?html + "'" />
	</#if>
	<#if column.parameters.clickStatus?exists>
		<#if hasClick == true>
			<#assign buttonOptions = buttonOptions + "," />
		<#else>
			<#assign hasClick = true />
		</#if>
		<#assign buttonOptions = buttonOptions + "'" + column.parameters.id?html + "':'" + column.parameters.clickStatus?html + "'" />
	</#if>
	<#if column.parameters.doubleClickAction?default(false)>
	Geni.ToolBar.setDoubleClickAction("${column.parameters.id?html}");
	</#if>
</#list>
<#assign options = options + "}" />
<#assign buttonOptions = buttonOptions + "}" />
<#if buttonOptions != "{}">
	Geni.ToolBar.addButtonOptions(${buttonOptions});
</#if>
<#if options != "{}">
	Geni.ToolBar.setToolBarStatus(${options});
</#if>
</script>